﻿using ExpertSystem.Exeptions;

namespace ExpertSystem.Domains
{
    class LargerThenFunction: Function
    {

        public LargerThenFunction():base()
        {
            _name = ">";
        }

        public override bool Calculate()
        {
            if (Variables.Count == 2)
            {
                int leftValue = 0;
                int.TryParse(Variables[0].Value.ToString(), out leftValue);
                int rightValue = 0;
                int.TryParse(Variables[1].Value.ToString(),out rightValue);
                return leftValue >= rightValue;
            }
            else
            {
                throw new WrongNumberOfArguments();
            }
        }
    }
}
